
import React from 'react';
import './index.less';

interface Iprops {
  checked: boolean;
  change: (param: boolean) => void;
}
const UiSwitch = (props: Iprops) => {
  const { checked, change } = props;
  return (
    <button onClick={change.bind(this, !checked)} type="button" className={`ui-switch ui-switch-${checked ? 'checked' : 'unchecked'}`}>
      <div className="ui-switch-handler">
        <span className="ui-switch-inner"></span>
      </div>
    </button>
  );
};

export default UiSwitch;
